package com.stu.mapper;

import com.stu.pojo.DormitoryRepair;
import com.stu.vo.DormitoryRepairVo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DormitoryRepairMapper {

    @Insert("insert into dormitory_repair" +
            "(stu_id, dormitory_address, request_context, request_time) " +
            "values " +
            "(#{stuId},#{dormitoryAddress},#{requestContext},#{requestTime})")
    void insertDormitoryRepair(DormitoryRepair dormitoryRepair);

    @Select("select * from dormitory_repair where stu_id = #{currentId}")
    List<DormitoryRepairVo> selectDormitoryRepair(Long currentId);

    void updateNotice(DormitoryRepair dormitoryRepair);

    /**
     * 查询所有宿舍维修申请
     * @return
     */
    @Select("select * from dormitory_repair")
    List<DormitoryRepairVo> dormitoryRepairApplicationAll();

}
